const express = require('express');
var server = express();
//cookie
const cookieparser = require('cookie-parser');
//                       签名和sercet要一致
server.use(cookieparser('yuonly123123123'));
server.use('/aaa/a.html',function(req,res){
    req.secret = 'yuonly123123123';
    //写入浏览器
    res.cookie('user','yuonly',{signed:true});
    res.cookie('pwd',123123);
    //签过名的
    console.log(req.signedCookies,'signed');
    //没签过的普通cookie
    console.log(req.cookies,'normal');

    res.send('ok');
})

server.listen(8080);
